const { robotService, newsService } = require('../utils/request')

const key = '906bf5d9629687084aa8818eff168623'

// 回复
function getReply(question) {
  return robotService({
    url: `/robot/?key=${key}&question=${question}`,
    method: 'get'
  })
}

// 早安
function getGoodMorningReply(){
  return robotService({
    url: `/zaoan/index?key=${key}`,
    method: 'get'
  })
}

// 晚安
function getGoodNightReply() {
  return robotService({
    url: `/wanan/index?key=${key}`,
    method: 'get'
  })
}

// 藏头诗
function getCangtoushi(word) {
  return robotService({
    url: `/cangtoushi/index?key=${key}&word=${word}`,
    method: 'get'
  })
}

// 星座运势
function getStar(taurus) {
  return robotService({
    url: `/star/index?key=${key}&astro=${taurus}`,
    method: 'get'
  })
}

// 神回复
function getGodreply() {
  return robotService({
    url: `/godreply/index?key=${key}`,
    method: 'get'
  })
}

// 凶吉测试
function getJixiong(number) {
  return robotService({
    url: `/jixiong/index?key=${key}&number=${number}`,
    method: 'get'
  })
}

// 电竞咨询
function getEsportNews(){
  return newsService({
    url: `/esports/index?key=${key}&word=dota2`,
    method: 'post'
  })
}

// 历史的今天
function getHistoryToday(date){
  return robotService({
    url: `/lishi/index?key=${key}&date=${date}`,
    method: 'get'
  })
}


// 生日性格
function getBirthDay(m, d){
  return robotService({
    url:`/dob/index?key=${key}&m=${m}&d=${d}`,
    method:'get'
  })
}

// 审核图片
function checkImage(imgurl){
  return robotService({
    url:`/imgcensor/index?key=${key}&imgurl=${imgurl}`,
    method:'get'
  })
}

// 周公结盟
function getDream(word){
  return robotService({
    url:`/dream/index?key=${key}&num=1&word=${word}`,
    method:'get'
  })
}

function getQuestion(){
  return robotService({
    url:`/riddle/index?key=${key}`,
    method:'get'
  })
}

function getSlogan(){
  return robotService({
    url:`/slogan/index?key=${key}`,
    method:'get'
  })
}

module.exports = {
  getReply,
  getGoodMorningReply,
  getGoodNightReply,
  getCangtoushi,
  getStar,
  getGodreply,
  getJixiong,
  getEsportNews,
  getHistoryToday,
  getBirthDay,
  checkImage,
  getDream,
  getQuestion,
  getSlogan
}